#ifndef TILESET_H
#define TILESET_H


#include "common.h"
#include <QPixmap>
#define MAX_TILE_PER_TILESET 200

typedef struct{
    bool isValid;
    int width;
    int height;
    int dataSize;
}tileInfo_t;

typedef struct{
    QPixmap *tilePic;
}tileRender_t;

typedef struct{
    tileInfo_t tileInfo;
    unsigned char *tileImgData_p;
    tileRender_t tileRender;
}tileMem_t;

extern tileMem_t tileSet[MAX_TILE_PER_TILESET];

bool init_tileset();
bool build_tileset_from_file(QString pathAndName);
bool add_tile_into_tileset(QString pathAndName, int tileId);
bool remove_tile_from_tileset(int tileId);
bool save_tileset_to_file(QString pathAndName);
bool release_tileset();



#endif// TILESET_H
